<template>
  <div>
    <van-tabbar v-model="active">
      <van-tabbar-item icon="home-o" @click="gohome">首页</van-tabbar-item>
      <van-tabbar-item icon="bar-chart-o" @click="golist">列表</van-tabbar-item>
      <van-tabbar-item icon="shopping-cart-o" @click="gocart">购物车</van-tabbar-item>
      <van-tabbar-item icon="contact" @click="gomy">{{msg}}</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
// import { nextTick } from 'vue';
export default {
  data() {
    return {
      active: 0,
      msg:"我的"           
    };
  },
  created(){

  },
  methods: {
    gohome() {
      this.$router.push("/");
      this.active = 0;

    },
    golist() {
      this.$router.push("/List");
      this.active = 1;

    },
    gomy() {
      this.$router.push("/My");
      this.active = 3;

    },
    gocart(){
      this.$router.push("/ShopingCart").catch((err)=>{});
      this.active = 2;

    }
  },
};
</script>

<style scoped>
</style>